local skill = fk.CreateSkill{
  name = "action__tianlei_skill",
}

Fk:loadTranslationTable{
  ["action__tianlei"] = "天雷",
  ["action__tianlei_skill"] = "天雷",
  [":action__tianlei"] = "锦囊牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：你 <br /><b>效果</b>：在所有角色的判定区内各放置一张游戏外的【闪电】。（不可响应）",
  ["#action__tianlei_skill"] = "在所有角色的判定区内各放置一张游戏外的【闪电】",
}

local U = require "packages/utility/utility"

skill:addEffect("cardskill", {
  mute = true,
  name = "action__tianlei",
  prompt = "#action__tianlei_skill",
  mod_target_filter = Util.TrueFunc,
  can_use = function(self, player, card)
    return not player:isProhibited(player, card)
  end,
  on_use = function(self, room, cardUseEvent)
    cardUseEvent.disresponsiveList = table.simpleClone(Fk:currentRoom().players)
    if not cardUseEvent.tos or #cardUseEvent.tos == 0 then
      cardUseEvent.tos = { cardUseEvent.from }
    end
  end,
  on_effect = function(self, room, effect)
    for _, p in ipairs(room.alive_players) do
      local card = room:printCard("lightning")
      room:addCardMark(card, MarkEnum.DestructIntoDiscard, 1)
      if not p:hasDelayedTrick("lightning") then
        room:moveCardTo(card, Card.PlayerJudge, p, fk.ReasonJustMove, self.name, nil, true, effect.to)
      end
    end
  end,
})


return skill